<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/layout/templateInformacao.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:define name="content">

        <h:form>

            <p>
                <ui:insert name="content">

                </ui:insert>
            </p>

            <p align="center">

                <rich:dataTable value="#{leilaoController.carregarLeilao()}" var="leilao" id="table" rows="20" rowClasses="odd-row, even-row"
                                styleClass="stable">

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Descrição" />

                        </f:facet>             
                        <h:outputText value="#{leilao.descricao}" />


                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Data do Início" />

                        </f:facet>      

                        <h:outputText value="#{leilao.data_criacao}">
                            <f:convertDateTime pattern="dd/MM/yyyy"/> 
                        </h:outputText>


                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Lance Inicial" />

                        </f:facet>             
                        <h:outputText value="#{leilao.lance_ini}">

                            <f:convertNumber type="currency"/>

                        </h:outputText>


                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Status" />

                        </f:facet>             
                        <h:outputText value="#{leilao.status}" />


                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Hora do Início" />

                        </f:facet>             
                        <h:outputText value="#{leilao.hora_criacao}" />


                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Produto" />

                        </f:facet>             
                        <h:outputText value="#{leilao.produto}" />


                    </rich:column>

                    <rich:column>

                        <f:facet name="header">

                            <h:outputText value="Duração"/>

                        </f:facet>

                        <h:outputText value="#{leilao.duracao}" />



                    </rich:column>

                </rich:dataTable>
            </p>

            <br/>

             <p:messages showDetail="true"/>
            

        </h:form>

    </ui:define>

    <rich:jQuery selector=".stable tr:odd" query="addClass('odd-row')" />
    <rich:jQuery selector=".stable tr:even" query="addClass('even-row')" />
    <rich:jQuery selector=".stable tr" event="mouseover"
                 query="jQuery(this).addClass('active-row')"/>
    <rich:jQuery selector=".stable tr" event="mouseout"
                 query="jQuery(this).removeClass('active-row')"/>
</ui:composition>